<template>

  <div ref="interview" style="height: 350px;width: 100%"/>

</template>

<script>


import * as echarts from 'echarts';

require('echarts/theme/macarons') //主题
export default {
  name: "lineChart",
  data() {
    return {
      interview: null
    }
  },
  methods: {
    initChart() {
      this.interview = echarts.init(this.$el, 'macarons')
      this.interview.setOption({
        title: {
          text: '访问数据统计'
        },
        tooltip: {
          trigger: 'axis'
        },
        legend: {
          data: ['IP访问量', 'PV页面访问量',"UV访客数量"]
        },
        grid: {
          left: '2%',
          right: '2%',
          bottom: '4%',
          containLabel: true
        },
        toolbox: {
          feature: {
            saveAsImage: {}
          }
        },
        xAxis: {
          type: 'category',
          boundaryGap: false,
          data: ['周一', '周二', '周三', '周四', '周五', '周六', '周日']
        },
        yAxis: {
          type: 'value'
        },
        series: [
          {
            name: 'IP访问量',
            type: 'line',
            stack: 'Total',
            data: [120, 132, 101, 134, 90, 230, 210]
          },
          {
            name: 'PV页面访问量',
            type: 'line',
            stack: 'Total',
            data: [220, 182, 191, 234, 290, 330, 310]
          },
          {
            name: 'UV访客数量',
            type: 'line',
            stack: 'Total',
            data: [360, 190, 491, 934, 390, 130, 50]
          }
        ]
      })
    }




  },
  mounted() {
    this.$nextTick(() => {
      this.initChart()
    })
  }
}
</script>

<!-- 去掉 scoped 全局生效 -->
<style scoped>

</style>
